project(MViewVTK)

include_directories(./include)
aux_source_directory(./src SRC_LIST)

file(GLOB_RECURSE QT_FILES "include/*.h" "*.qrc")
message(STATUS "QT_FILES:")
foreach(file ${QT_FILES})
    message(STATUS "${file}")
endforeach()

add_executable(${PROJECT_NAME} ${SRC_LIST} ${QT_FILES}) 

target_link_libraries(
        ${PROJECT_NAME}
        Qt6::Core 
        Qt6::Widgets
        Qt6::Gui 
        ${VTK_LIBRARIES}
        ${OpenCASCADE_LIBRARIES}
        )

vtk_module_autoinit(TARGETS ${PROJECT_NAME} MODULES ${VTK_LIBRARIES})

file(GLOB_RECURSE QT_PLATFORMS "C:/Qt/6.6.3/msvc2019_64/plugins/platforms/*.dll")
install(FILES ${QT_PLATFORMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/platforms)
file(GLOB_RECURSE QT_IMAGEFORMATS "C:/Qt/6.6.3/msvc2019_64/plugins/imageformats/*.dll")
install(FILES ${QT_IMAGEFORMATS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/imageformats)
file(GLOB_RECURSE QT_STYLES "C:/Qt/6.6.3/msvc2019_64/plugins/styles/*.dll")
install(FILES ${QT_STYLES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/styles)

set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE OFF)